package SV_INT_OVF;
import jakarta.servlet.http.*;
public class Vulnerable_02 {
    protected void doPost(HttpServletRequest req,
                          HttpServletResponse resp) throws ServletException,
            IOException {
        String amount = req.getParameter("creditAmount");
        int value = Integer.parseInt(amount);
        int prevCreditBalance = getCreditBalance(req
                .getParameter("user"));
        // maximum credit is 5000
        if (prevCreditBalance + value > 5000) {
            // transaction
            dosomething();
        }
        // ...
    }
}
